package com.ruoyi.xiche.controller;

//import com.ruoyi.xiche.dto.StoreServiceDTO;
import com.ruoyi.xiche.domain.ServiceItem;
import com.ruoyi.xiche.domain.StoreServiceDTO;
import com.ruoyi.xiche.service.ServiceItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/serviceItem")
public class ServiceItemController {

    @Autowired
    private ServiceItemService serviceItemService;

    //根据ID获取服务项
    @GetMapping("/id")
    public ServiceItem getServiceItem(@RequestParam("id") Integer id) {
        return serviceItemService.getById(id);
    }

    //查询店铺的服务列表
    @GetMapping("/getByStoreId")
    public StoreServiceDTO getServiceItemsByStoreId(@RequestParam Long storeId) {
        return serviceItemService.getServiceItemsByStoreId(storeId);
    }
}
